//
//  CCNetWorkingTool.h
//  liveDemo
//
//  Created by 郭冰燚 on 2016/12/12.
//  Copyright © 2016年 郭冰燚. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef void (^CCHttpSuccessBlock)(id json ,NSString *url);
typedef void(^CCHttpFailureBlock)(NSError * error ,NSString *url);
typedef void(^CCHttpDownloadProGressBlock)(CGFloat progress);
typedef void(^CCHttpUploadProgressBlock)(CGFloat progress);

@interface CCNetWorkingTool : NSObject

+ (instancetype)sharedClient;

+ (void)getWithPath:(NSString *)path
            params:(NSDictionary *)params
           success:(CCHttpSuccessBlock)success
           failure:(CCHttpFailureBlock)failure;

+ (void)postWithPath:(NSString*)path
             params:(NSDictionary *)params
            success:(CCHttpSuccessBlock)success
            failure:(CCHttpFailureBlock)failure;

+ (void)downloadWithPath:(NSString *)path
                 succes:(CCHttpSuccessBlock)success
                failure:(CCHttpFailureBlock)failure
                progress:(CCHttpDownloadProGressBlock)progress;


+ (void)uploadImageWithPath:(NSString *)path
                     parame:(NSDictionary *)parame
                  thumbName:(NSString *) imagekey
                      iamge:(UIImage *)image
                    success:(CCHttpSuccessBlock)success
                    failure:(CCHttpFailureBlock)failure
                   progress:(CCHttpUploadProgressBlock)progress;


@end


